package lib.junit;

import org.junit.*;

import static org.junit.Assert.*;

public class QuickStart {
    public int add(int a, int b) {
        return a + b;
    }

    @Test
    public void testAdd() {
        QuickStart start = new QuickStart();
        assertEquals(3, start.add(1, 2));
        assertEquals(30, start.add(10, 20));
    }

    @Ignore
    @Test
    public void testIgnore() {
        QuickStart start = new QuickStart();
        assertEquals(300, start.add(10, 20));
    }

    @Before
    public void before() {
        System.out.println("before...");
    }

    @Test
    public void testBefore() {
        System.out.println("testBefore");
    }

    @After
    public void after() {
        System.out.println("after...");
    }

    @Test
    public void testAssertEquals() {
        assertEquals(1, 1);
        assertEquals("", "");
        assertEquals(0.0, 0.0, 0.1);
    }

    @Test
    public void testAssertNull() {
        assertNull(null);
    }

    @Test
    public void testAssertNotNull() {
        assertNotNull(Boolean.TRUE);
    }
}
